﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace T2task1
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlDataReader reader = null;
                string sql = "select NO,Name,price,stock,price*stock Total from Info";
                reader=DBHelper.Select
                Console.WriteLine("序号\t游戏名称\t游戏介绍\t库存数量\t小计");
                Console.WriteLine("+------------------------------------------------------");
                while (reader.Read())
                {
                    Console.WriteLine("{0}\t{1}\t{2:C}元\t\t{3}\t{4:C}元",
                    reader["NO"],
                    reader["Name"],
                    reader["price"],
                    reader["stock"],
                    reader["Total"]

                        );
                }
                reader.Close();
                Console.WriteLine("+------------------------------------------------------");
                string totalSql = "select sum(Price*Stock) from Info";
                string sum = string.Format("{0}", cmd.ExecuteScalar());
                Console.WriteLine("游戏总金额：{0}元",sum);
            
        }
    }
}
